import React from "react";

import useStore from "./hooks/useStore";

function Counter() {
  const { state, dispatch } = useStore();
  return (
    <>
      Count: {state.count}
      <button onClick={() => dispatch({ type: "decrement" })}>-</button>
      <button onClick={() => dispatch({ type: "increment" })}>+</button>
    </>
  );
}

export default Counter;
